package org.xx.armory.swing.components;

import org.xx.armory.swing.components.verifiers.VerifiedStatus;

import java.awt.AWTEvent;

import static org.xx.armory.commons.Validators.notNull;

/**
 * 验证失败事件。
 */
public class VerificationEvent
        extends AWTEvent {
    public static final int SUCCESS = 1;
    public static final int ERROR = 2;

    private VerifiedStatus status;

    public VerificationEvent(
            Object source,
            int id,
            VerifiedStatus status
    ) {
        super(source, id);

        this.status = notNull(status, "status");
    }

    /**
     * 获取验证失败的状态。
     *
     * @return 验证失败的状态。
     */
    public final VerifiedStatus getStatus() {
        return this.status;
    }
}
